package User;

import Book.BookList;
import operation.IOperation;

/**
 * Created with IntelliJ IDEA.
 * User: wenxiwen
 * Date: 2022/4/13
 * Time: 18:27
 * Description: No Description
 */


public abstract class Animal {
    protected String name;
    IOperation[] ioperation;//1.父类引用数组指向不同的子类对象  向上转型

    public Animal(String name) {
        this.name = name;
    }

    //抽象类要自己进行修饰  接口才是默认
    public abstract int menu();

    public void Usertion(int pos, BookList booklist) {
        ioperation[pos].work(booklist);//2.父类通过下标来确定是哪个功能对象的引用从而调用相应的重写方法
    }
}